<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <!-- import CSS -->
  <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
  <title>woodwhales-media</title>
</head>
<body>
<div id="app">
  <el-row>
    <el-col :span="24" style="text-align: center"><h1>woodwhales-media</h1></el-col>
  </el-row>
  <el-row :gutter="20">
    <el-col :span="2">&nbsp;</el-col>
    <el-col :span="20">
      <el-form ref="form" :model="form" label-width="80px">
        <el-form-item label="活动名称">
          <el-input v-model="form.name"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="onParse">解析</el-button>
          <el-button>取消</el-button>
        </el-form-item>
      </el-form>
    </el-col>
    <el-col :span="2">&nbsp;</el-col>
  </el-row>
</div>
</body>
<!-- import Vue before Element -->
<script src="https://unpkg.com/vue@2/dist/vue.js"></script>
<!-- import JavaScript -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js" rel="external nofollow"></script>
<script th:inline="none">
  new Vue({
    el: '#app',
    data: function () {
      return {
        form: {
          name: info.name
        }
      }
    },
    methods: {
      onParse() {
        if (this.form.html === '') {
          this.$message.error('html不允许为空');
          return;
        }
        axios.post('/api/parse', {
          html: this.form.html
        })
                .then(function (response) {
                  console.log(response);
                })
                .catch(function (error) {
                  console.log(error);
                });

      }
    }
  })
</script>
</html>